package cn.school.filter;

import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

//监听session的创建和销毁
@WebListener
public class MyListener implements HttpSessionListener {

	@Override
	public void sessionCreated(HttpSessionEvent arg0) {
		System.out.println("session id=" + arg0.getSession().getId() + "被创建了" + new java.util.Date());

	}

	@Override
	public void sessionDestroyed(HttpSessionEvent arg0) {
		System.out.println("session id=" + arg0.getSession().getId() + "被销毁了，" + new java.util.Date());

	}

}
